import { reactive, toRefs } from "vue"

export const useCity = () => {
    const data = reactive({
        city: "武汉",
        setCity() {
            data.city = "杭州"
        }
    })
    return toRefs(data);
}
export const useCount = () => {
    const count = ref(10);
    const setCount = () => {
        count.value++;
    }
    const double = computed(() => {
        return count.value * 2
    })
    return { count, setCount, double }
}